package cn.lgwen.spark.ml.learning

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SparkSession
import org.apache.spark.{SparkConf, SparkContext}


/**
 * 2020/3/9
 * aven.wu
 * danxieai258@163.com
 */
object SparkHelloWord {

  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("hello word").setMaster("local[*]")
    val context = new SparkContext(conf)
    val data = Array(1, 2,2,3,5)
    val distData: RDD[Int] = context.parallelize(data)
    println(distData.count())

    val spark = SparkSession
      .builder()
      .appName("Spark SQL basic example")
      .config("spark.some.config.option", "some-value")
      .getOrCreate()
  }
}
